package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.SetMeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.SetMealMapper;
import com.ruoyi.order.service.ISetMealService;

/**
 * 套餐Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-19
 */
@Service
public class SetMealServiceImpl implements ISetMealService 
{
    @Autowired
    private SetMealMapper setMealMapper;

    /**
     * 查询套餐
     * 
     * @param setMealId 套餐主键
     * @return 套餐
     */
    @Override
    public SetMeal selectSetMealBySetMealId(Long setMealId)
    {
        return setMealMapper.selectSetMealBySetMealId(setMealId);
    }

    /**
     * 查询套餐列表
     * 
     * @param setMeal 套餐
     * @return 套餐
     */
    @Override
    public List<SetMeal> selectSetMealList(SetMeal setMeal)
    {
        return setMealMapper.selectSetMealList(setMeal);
    }

    /**
     * 新增套餐
     * 
     * @param setMeal 套餐
     * @return 结果
     */
    @Override
    public int insertSetMeal(SetMeal setMeal)
    {
        setMeal.setCreateTime(DateUtils.getNowDate());
        return setMealMapper.insertSetMeal(setMeal);
    }

    /**
     * 修改套餐
     * 
     * @param setMeal 套餐
     * @return 结果
     */
    @Override
    public int updateSetMeal(SetMeal setMeal)
    {
        setMeal.setUpdateTime(DateUtils.getNowDate());
        return setMealMapper.updateSetMeal(setMeal);
    }

    /**
     * 批量删除套餐
     * 
     * @param setMealIds 需要删除的套餐主键
     * @return 结果
     */
    @Override
    public int deleteSetMealBySetMealIds(Long[] setMealIds)
    {
        return setMealMapper.deleteSetMealBySetMealIds(setMealIds);
    }

    /**
     * 删除套餐信息
     * 
     * @param setMealId 套餐主键
     * @return 结果
     */
    @Override
    public int deleteSetMealBySetMealId(Long setMealId)
    {
        return setMealMapper.deleteSetMealBySetMealId(setMealId);
    }
}
